Task Result
Last Update: 2025/3/26
The Task Result API allows you to retrieve information about a specific task using either the task ID or external task ID. This document provides details about the API endpoint, request parameters, and response structure.
Endpoint
GET https://platform.llmprovider.ai/v1/task/{task_id}
Request Headers
Header | Value | Description |
---|---|---|
Authorization | Bearer YOUR_API_KEY | Authentication token |
Content-Type | application/json | Data exchange format |
Path Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
task_id | string | No | None | Task ID for video generation |
external_task_id | string | No | None | Custom task ID specified during task creation |
Note: You must provide either task_id
or external_task_id
, but not both.
Response Body
The response body will be a JSON object containing the task information and status.
Field | Type | Description |
---|---|---|
task_id | string | System-generated task ID |
task_status | string | Task status (submitted/processing/succeed/failed) |
task_status_msg | string | Task status message, shows failure reason if applicable |
created_at | integer | Task creation timestamp (Unix timestamp in ms) |
updated_at | integer | Task update timestamp (Unix timestamp in ms) |
Example Response
{
"task_id": "string",
"task_status": "string",
"task_status_msg": "string",
"task_info": {
"external_task_id": "string"
},
"task_result": {
"videos": [
{
"id": "string",
"url": "string",
"duration": "string"
}
]
},
"created_at": 1722769557708,
"updated_at": 1722769557708
}
Example Request
- Shell
- nodejs
- python
curl -X GET https://platform.llmprovider.ai/v1/task/{task_id} \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json"
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const taskId = 'YOUR_TASK_ID';
const url = `https://platform.llmprovider.ai/v1/task/${taskId}`;
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
};
axios.get(url, { headers })
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error);
});
import requests
api_key = 'YOUR_API_KEY'
task_id = 'YOUR_TASK_ID'
url = f'https://platform.llmprovider.ai/v1/task/{task_id}'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print('Response:', response.json())
else:
print('Error:', response.status_code, response.text)
Note: Generated videos are retained for 30 days. Please ensure to save them before they expire.